package com.smallkk.user.service;

import com.smallkk.user.dao.UserMapper;
import com.smallkk.user.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created By  醉美柳舞之众星捧月
 *
 * @author song
 * @date 2018/1/2 15:51
 */
@Service
public class UserServiceImpl implements UserService {
    /**
     * 实现接口 写方法
     */
    @Autowired
    private UserMapper userMapper;
    /**
     * Author song  醉美柳舞之众星捧月
     * Date & Time  2018/1/2 15:55
     * Description  此页面为业务代码
     */
    /**
     * Author song  醉美柳舞之众星捧月
     * Date & Time  2018/1/2 15:56
     * Description  添加用户业务 注意主键重复冲突
     */
    @Override
    public User addUser() {
        User user = new User();
        user.setId(1L);
        user.setHeadImage("头像的路径");
        user.setMobile("10086");
        user.setPassword("admin");
        user.setRealName("醉美柳舞之众星捧月");
        user.setUsername("song");
        int result = userMapper.insertSelective(user);
        if (result > 0) {
            System.out.println("实现层插入数据成功");
        } else {
            System.out.println("Error:::");
        }
        return null;
    }
}
